﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using buildingLib.daily;

namespace _dmis
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        buildingLib.daily.FTP_File file;

        private void Form1_Load(object sender, EventArgs e)
        {
           fTP_FileBindingSource.DataSource = file = buildingLib.daily.FTP_File.NewFile();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //fTP_FileBindingSource.EndEdit();
            //file.Save();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            fTP_FileBindingSource.EndEdit();
            fTP_FileBindingSource.DataSource = file = buildingLib.daily.FTP_File.GetFile(1);
            fTP_FileBindingSource.ResetBindings(false);

        }

        private void button1_Click_2(object sender, EventArgs e)
        {
            fTP_FileBindingSource.EndEdit();
            file.Save();
        }

        private void fTP_FileBindingSource_CurrentItemChanged(object sender, EventArgs e)
        {
            this.button1.Enabled = file.IsSavable;
        }

        private void aIDTextBox_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
